package net.xxcxcxcx.xc_enhancedmob.skills.basics.individual.common;

import net.minecraft.entity.mob.MobEntity;
import net.minecraft.nbt.NbtCompound;
import net.xxcxcxcx.xc_enhancedmob.config.skill.SkillConfig;
import net.xxcxcxcx.xc_enhancedmob.skills.BaseSkill;

public class VitalitySkill extends BaseSkill {

    public VitalitySkill(int level) {
        super(level);
    }

    public VitalitySkill(NbtCompound nbtCompound) {
        super(nbtCompound);
    }

    public VitalitySkill() {
    }

    @Override
    public SkillConfig getDefaultConfig() {
        SkillConfig skillConfig = super.getDefaultConfig();
        skillConfig.setMessage(getConfigMessage(skillConfig));
        return skillConfig;
    }

    @Override
    public String getConfigMessage(SkillConfig skillConfig) {
        if (skillConfig == null) return super.getConfigMessage(null);
        return String.format("活力技能，增加 （level*5）/5秒的恢复速度");
    }

    @Override
    public boolean passiveApply(MobEntity mobEntity) {
        if (mobEntity.world.getTime() % 100 == 0) mobEntity.heal(getSkillLevel() * 5);
        return true;
    }
}
